package studentproject.main.dao;


import studentproject.main.domain.Teacher;

import java.util.ArrayList;

public class TeacherDao {
    public static ArrayList<Teacher> list = new ArrayList<>();

    public ArrayList<Teacher> find() {
        return list;
    }

    public boolean add(Teacher teacher) {
        list.add(teacher);
        return true;
    }

    public boolean update(int index,Teacher teacher) {
        list.set(index,teacher);
        return true;
    }

    public boolean delete(int index) {
        list.remove(index);
        return true;
    }

    public boolean getList() {
        if(list.size() == 0){
            return false;
        }else {
            return true;
        }
    }
}
